ATR5 Gerchik&CoThis script is designed to calculate and display the Average True Range (ATR) based on the last 5 bars on a daily (D1) chart. The ATR is a key indicator used to measure market volatility by decomposing the entire range of an asset price for that period. Additionally, the script provides a visual representation of the percentage of the current day's range relative to the calculated ATR.
How It Works
Calculation of ATR:
The script calculates the ATR by taking the high and low of each of the last 5 daily bars, computing the range for each bar, and then averaging these values.
The ATR value is then dynamically formatted based on the decimal places relevant to the asset's tick size.
Percentage of Current Day's Range:
The script also calculates the percentage of the current day's range compared to the ATR. This helps traders quickly assess how much of the average range has been covered today.
Visual Display:
The ATR value and the percentage of the current day's range are displayed in the top-right corner of the chart for easy reference.
Usage
Identifying Volatility: The ATR is a widely used indicator to identify periods of high and low volatility in the market. Traders can use this to adjust their strategies accordingly, such as widening or tightening stop-loss levels.
Entry and Exit Points: Knowing the ATR can help traders decide on optimal entry and exit points based on expected market movements.
Risk Management: By understanding the market volatility, traders can better manage their risk by adjusting position sizes and stop-loss levels.
Example
The script shows the ATR calculated over the last 5 days, formatted to match the asset's decimal places.
It also displays the current day's range as a percentage of the ATR, providing immediate insight into the day's volatility relative to the recent average.
How to Use
Apply the Script: Add the script to your TradingView chart.
Analyze the Display: Observe the ATR value and the percentage of the current day's range displayed in the top-right corner.
Make Informed Decisions: Use the information to make informed trading decisions based on the volatility and range of the asset.
Code Explanation
The script uses Pine Script v5 and includes functions to calculate the range of bars, average these ranges, and format the output appropriately. The ATR value and percentage are displayed using the table functionality to ensure clear and precise placement on the chart.
This description should provide users with a clear understanding of what the script does, how it can be used, and the concepts behind its calculations. Let me know if you need any further adjustments or additional details!
Search in scripts for "THE SCRIPT"
Psychological Levels [UkutaLabs]█ OVERVIEW
The Psychological Levels Indicator provides real-time insight into key price levels within the market that can serve as powerful support and resistance levels. These levels are updated automatically in real time to display only the most relevant levels to the current price, facilitating your trading experience.
The aim of this script is to simplify the trading experience of users by automatically identifying and displaying price levels that they should be aware of.
█ USAGE
On each tick, the nearest key price level is automatically identified by the script. The script will identify this level based on the price of the commodity you are applying it to:
• Commodities priced at $0 to $999.99 will identify the nearest whole dollar.
• Commodities priced at $1,000 to $9,999.99 will identify the nearest $10.
• Commodities priced at $10,000 to $99,999.99 will identify the nearest $100.
• Commodities priced over $100,000 will identify the nearest $1,000.
We refer to this rounding price as the gap price, and it is also used to determine the prices of the other lines drawn by this script.
After identifying the nearest key price level, the script then incrementally draws lines on either side of this level at an interval of the gap price. We refer to these as the Major Lines, and the user can control the number of these lines that get drawn, the style of these lines, and they can be disabled in the settings.
The script then draws lines at the half-way point between each of these Major Lines, and we refer to these as the Minor Lines. Like the Major Lines, the user has full control over the number of these lines that can be drawn, the style of these lines, and they can be disabled in the settings.
█ SETTINGS
Configuration
• Number of Lines: Determines the number of lines that are drawn on either side of the key price line. This controls both the number of Major Lines and Minor Lines.
Line Settings
• Major Lines: Determines whether or not the Major Lines will be displayed.
- Color: Determines the color of Major Lines.
- Style: Determines the style of Major Lines.
- Width: Determines the width of Major Lines
• Minor Lines: Determines whether or not the Minor Lines will be displayed.
- Color: Determines the color of Minor Lines
- Style: Determines the style of Minor Lines
- Width: Determines the width of Minor Lines
Century Levels [UkutaLabs]█ OVERVIEW
The Century Levels Indicator provides real-time insight into key price levels within the market that can serve as powerful support and resistance levels. These levels are updated automatically in real time to display only the most relevant levels to the current price, facilitating your trading experience.
The aim of this script is to simplify the trading experience of users by automatically identifying and displaying price levels that they should be aware of.
█ USAGE
On each tick, the nearest key price level is automatically identified by the script. The script will identify this level based on the price of the commodity you are applying it to:
• Commodities priced at $0 to $999.99 will identify the nearest whole dollar.
• Commodities priced at $1'000 to $9'999.99 will identify the nearest $10.
• Commodities priced at $10'000 to $99'999.99 will identify the nearest $100.
• Commodities priced over $1'000'000 will identify the nearest $1000.
We refer to this rounding price as the gap price, and it is also used to determine the prices of the other lines drawn by this script.
After identifying the nearest key price level, the script then incrementally draws lines on either side of this level at an interval of the gap price. We refer to these as the Major Lines, and the user can control the number of these lines that get drawn, the style of these lines, and they can be disabled in the settings.
The script then draws lines at the half-way point between each of these Major Lines, and we refer to these as the Minor Lines. Like the Major Lines, the user has full control over the number of these lines that can be drawn, the style of these lines, and they can be disabled in the settings.
█ SETTINGS
Configuration
• Number of Lines: Determines the number of lines that are drawn on either side of the key price line. This controls both the number of Major Lines and Minor Lines.
Line Settings
• Major Lines: Determines whether or not the Major Lines will be displayed.
- Color: Determines the color of Major Lines.
- Style: Determines the style of Major Lines.
- Width: Determines the width of Major Lines
• Minor Lines: Determines whether or not the Minor Lines will be displayed.
- Color: Determines the color of Minor Lines
- Style: Determines the style of Minor Lines
- Width: Determines the width of Minor Lines
TSF 20What kind of traders/investors are we?
We are trend followers. We look for assets that are outperforming the market. Our scripts are designed to be used on the higher timeframes (weekly/daily) to catch the large moves/trends in the market.
Our scripts have been designed to help you follow the trend in an asset.
What does this script do?
This script is designed to colour candles on a chart based on their position relative to two sets of Bollinger Bands. Here's a breakdown of how it functions:
Bollinger Bands Setup:
The script uses two sets of Bollinger Bands, both with a length of 20 and based on the closing prices of candles.
The first set of Bollinger Bands uses a standard deviation (StdDev) of 1.
The second set uses a standard deviation of 2.
Neither set of bands is displayed on the chart.
Coloring Candles:
Green Candle: A candle is coloured green if its close is above the upper Bollinger Band with StdDev 1 but below the upper Bollinger Band with StdDev 2. This indicates a moderately bullish sentiment.
Dark Green Candle: A candle is colored dark green when its close is above the upper Bollinger Band with StdDev 2. This implies a stronger bullish sentiment.
Red Candle: A candle is coloured red if its close is below the lower Bollinger Band with StdDev 1 but above the lower Bollinger Band with StdDev 2. This indicates a moderately bearish sentiment.
Dark Red Candle: A candle is colored dark red if its close is below the lower Bollinger Band with StdDev 2, indicating a stronger bearish sentiment.
Grey Candle: A candle is coloured grey if it closes between the upper and lower Bollinger Bands with StdDev 1. This usually signifies a neutral market condition or periods of consolidation.
In summary, this script is an analytical tool that visually represents the market's bullishness or bearishness relative to the Bollinger Bands, without displaying the bands themselves. It's designed to help investors quickly assess market conditions and sentiment based on the colour-coded representation of price action in relation to these volatility bands.
What makes this script unique?
Innovative Color-Coding System: Candles are colored in varying shades of green and red, providing an immediate visual cue about the market's bullish or bearish tendencies. A neutral grey is also used, offering a quick assessment of market indecision or consolidation phases.
Dual Bollinger Band Analysis: Utilizes two sets of Bollinger Bands (StdDev 1 and StdDev 2) to gauge market volatility and sentiment. This dual-band approach enhances the precision of sentiment analysis compared to using a single standard deviation.
Customizable and Non-Obtrusive: Designed to keep your charts clean and readable. The Bollinger Bands themselves are not displayed, reducing visual clutter and allowing for a focus on price action.
Versatile and Adaptable: Suitable for various trading styles and timeframes. Whether you are a short-term or long-term investor, this indicator can be seamlessly integrated into your analysis toolkit.
Valuable Addition to Market Analysis: Enhances traditional candlestick analysis and complements other technical indicators and strategies. It offers an additional layer of understanding market dynamics and can be used to confirm or question other signals.
How It Adds Value:
Enhanced Visual Analysis: By colour-coding candles based on Bollinger Band positioning, it simplifies the interpretation of market sentiment and volatility, making it easier to spot trends and reversals.
Strategic Decision Making: Helps traders make more informed decisions by clearly highlighting bullish and bearish strength, or lack thereof, in the market.
Time Efficiency: Reduces the time spent analyzing charts by providing an immediate visual representation of market conditions.
Originality: Offers a fresh perspective and an innovative approach to using Bollinger Bands, making it a unique addition to the community's toolbox.
Day/Week/Month Metrics (Zeiierman)█ Overview
The Day/Week/Month Metrics (Zeiierman) indicator is a powerful tool for traders looking to incorporate historical performance into their trading strategy. It computes statistical metrics related to the performance of a trading instrument on different time scales: daily, weekly, and monthly. Breaking down the performance into daily, weekly, and monthly metrics provides a granular view of the instrument's behavior.
The indicator requires the chart to be set on a daily timeframe.
█ Key Statistics
⚪ Day in month
The performance of financial markets can show variability across different days within a month. This phenomenon, often referred to as the "monthly effect" or "turn-of-the-month effect," suggests that certain days of the month, especially the first and last days, tend to exhibit higher than average returns in many stock markets around the world. This effect is attributed to various factors including payroll contributions, investment of monthly dividends, and psychological factors among traders and investors.
⚪ Edge
The Edge calculation identifies days within a month that consistently outperform the average monthly trading performance. It provides a statistical advantage by quantifying how often trading on these specific days yields better returns than the overall monthly average. This insight helps traders understand not just when returns might be higher, but also how reliable these patterns are over time. By focusing on days with a higher "Edge," traders can potentially increase their chances of success by aligning their strategies with historically more profitable days.
⚪ Month
Historically, the stock market has exhibited seasonal trends, with certain months showing distinct patterns of performance. One of the most well-documented patterns is the "Sell in May and go away" phenomenon, suggesting that the period from November to April has historically brought significantly stronger gains in many major stock indices compared to the period from May to October. This pattern highlights the potential impact of seasonal investor sentiment and activities on market performance.
⚪ Day in week
Various studies have identified the "day-of-the-week effect," where certain days of the week, particularly Monday and Friday, show different average returns compared to other weekdays. Historically, Mondays have been associated with lower or negative average returns in many markets, a phenomenon often linked to the settlement of trades from the previous week and negative news accumulation over the weekend. Fridays, on the other hand, might exhibit positive bias as investors adjust positions ahead of the weekend.
⚪ Week in month
The performance of markets can also vary within different weeks of the month, with some studies suggesting a "week of the month effect." Typically, the first and the last week of the month may show stronger performance compared to the middle weeks. This pattern can be influenced by factors such as the timing of economic reports, monthly investment flows, and options and futures expiration dates which tend to cluster around these periods, affecting investor behavior and market liquidity.
█ How It Works
⚪ Day in Month
For each day of the month (1-31), the script calculates the average percentage change between the opening and closing prices of a trading instrument. This metric helps identify which days have historically been more volatile or profitable.
It uses arrays to store the sum of percentage changes for each day and the total occurrences of each day to calculate the average percentage change.
⚪ Month
The script calculates the overall gain for each month (January-December) by comparing the closing price at the start of a month to the closing price at the end, expressed as a percentage. This metric offers insights into which months might offer better trading opportunities based on historical performance.
Monthly gains are tracked using arrays that store the sum of these gains for each month and the count of occurrences to calculate the average monthly gain.
⚪ Day in Week
Similar to the day in the month analysis, the script evaluates the average percentage change between the opening and closing prices for each day of the week (Monday-Sunday). This information can be used to assess which days of the week are typically more favorable for trading.
The script uses arrays to accumulate percentage changes and occurrences for each weekday, allowing for the calculation of average changes per day of the week.
⚪ Week in Month
The script assesses the performance of each week within a month, identifying the gain from the start to the end of each week, expressed as a percentage. This can help traders understand which weeks within a month may have historically presented better trading conditions.
It employs arrays to track the weekly gains and the number of weeks, using a counter to identify which week of the month it is (1-4), allowing for the calculation of average weekly gains.
█ How to Use
Traders can use this indicator to identify patterns or trends in the instrument's performance. For example, if a particular day of the week consistently shows a higher percentage of bullish closes, a trader might consider this in their strategy. Similarly, if certain months show stronger performance historically, this information could influence trading decisions.
Identifying High-Performance Days and Periods
Day in Month & Day in Week Analysis: By examining the average percentage change for each day of the month and week, traders can identify specific days that historically have shown higher volatility or profitability. This allows for targeted trading strategies, focusing on these high-performance days to maximize potential gains.
Month Analysis: Understanding which months have historically provided better returns enables traders to adjust their trading intensity or capital allocation in anticipation of seasonally stronger or weaker periods.
Week in Month Analysis: Identifying which weeks within a month have historically been more profitable can help traders plan their trades around these periods, potentially increasing their chances of success.
█ Settings
Enable or disable the types of statistics you want to display in the table.
Table Size: Users can select the size of the table displayed on the chart, ranging from "Tiny" to "Auto," which adjusts based on screen size.
Table Position: Users can choose the location of the table on the chart
-----------------
Disclaimer
The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!
IU Support and Resistance How this script works :
1. This script is an indicator script which calculates the support and resistance based on pivot high and pivot low and plot them as zone onto the chart.
2. The first user input is minimum number of touches which indicates how many time pivot high or pivot low should be tested in order to be a valid support or resistance level.
3.The second user input "Set Buffer" check if the user wants to use a custom buffer or not if it's unchanged then the default is 50% of the 1000 period ATR value .
4. If "Set Buffer" is checked meaning if it's set to true then only the third user input will be execute which is the "buffer" which indicates how much price range user wants his zone to have.
5. After the user input part this script create two arrays to store the pivot high and pivot low values every time he have a new value.
6. This script also creates two arrays to store the bar index of the bar where the new pivot high or pivot low is detected those bar index will be later use while creating the support and resistance zones.
7. Then the script creates four more arrays to store the final support and resistance values and their respective bar index which will be use for creating the support and resistance zones.
8. After this the script check that we are at the last bar of our chart if we are then we sort the support and resistance indices by descending order and store them into an new variable after that we sort the support and resistance arrays by descending order, then we loop through the arrays elements and we check if the previous element comes under the zone of the current element if so we increase the "minimum touch" variable by 1, once we have 5 or more count in our variable and we no longer have a valid zone then we store the element value and the sorted index of the element into our final arrays.
9. Finally the script will loop through the final support and resistance arrays and it will create a box for each support and resistance with respect to extending it on both directions.
10.The green zones are the support and the red zones are the resistance.
How user can benifits from this script:
1. User can automatically identify support and resistance zones and he can plan his trade as per that.
2. User can test how different markets reacts with support and resistance zones.
3. User can plan breakout trade on the break of the support or resistance level.
4. User can adjust he stop loss and take profit as per the support and resistance zones.
Linear Reg CandlesThe provided Pine Script is a TradingView script for creating a technical analysis indicator called "Humble LinReg Candles." This script includes features such as linear regression for open, high, low, and close prices, signal smoothing with simple or exponential moving averages, and a trailing stop based on Average True Range (ATR). Additionally, the script contains a screener section to display signals for a list of specified symbols.
Here is a breakdown of the script:
Indicator Settings:
It defines various input parameters such as signal smoothing length, linear regression settings, and options for using simple moving averages.
Linear regression is applied to open, high, low, and close prices based on user-defined settings.
ATR Trailing Stop:
It calculates the Average True Range (ATR) and uses it to determine a trailing stop for buy and sell signals.
Signals are generated based on whether the close price is above or below the ATR trailing stop.
Plotting:
The script plots the calculated signal on the chart using the plot function.
Buy and Sell Conditions:
Buy and sell conditions are defined based on the relationship between the close price and the ATR trailing stop.
Plot shapes and bar colors are used to visually represent buy and sell signals on the chart.
Alerts:
Alerts are triggered when buy or sell conditions are met.
Screener Section:
The script defines a screener section to display a watchlist of symbols with long and short signals.
The watchlist includes a set of predefined symbols with corresponding long and short signals.
Table Theme Settings:
The script allows customization of the table theme, including background color, frame color, and text color.
The size and location of the table on the chart can also be customized.
Screener Function:
A function getSignal is defined to determine long and short signals for each symbol in the watchlist.
The getSym function is used to extract the symbol name from the symbol string.
Dashboard Creation:
The script creates a table (dashboard) to display long and short signals for the symbols in the watchlist.
The table includes headers for "Long Signal" and "Short Signal" and lists the symbols with corresponding signals.
Overall, the script combines technical analysis indicators and a screener to help traders identify potential buy and sell signals for a set of specified symbols.
Kiss Of DeathThis Pine Script code is designed to create a technical indicator on a TradingView chart known as the "Kiss of Death" signal. Here's a description of the script:
The script begins by specifying that it is intended for use with Pine Script version 5 (//@version=5) and sets the indicator's title to "Kiss of Death Signal" with indicator(title="Kiss of Death Signal", overlay=true).
The code calculates a 21-period Exponential Moving Average (EMA) of the closing prices (ema21 = ta.ema(close, 21)). The EMA is a commonly used trend-following indicator.
It also determines the lowest low of the previous two periods (prev_low = ta.lowest(low, 2)). This variable will be used in the signal condition.
The script then defines the signal condition for the "Kiss of Death" pattern. This pattern occurs when:
The current closing price is below the 21-period EMA (close < ema21).
The previous closing price is above or equal to the 21-period EMA (close >= ema21).
The current low is below the lowest low of the previous two periods (low < prev_low).
Next, it uses plot to display the 21-period EMA on the chart (plot(ema21, color=color.blue, title="21 EMA")), using a blue color.
Finally, the script utilizes plotshape to mark the points on the chart where the "Kiss of Death" signal condition is met. It places a red, downward-pointing triangle above the corresponding bars
In summary, this script provides a visual representation of the "Kiss of Death" signal on a TradingView chart, helping traders identify potential bearish reversal points based on the defined conditions. The 21-period EMA is also displayed to provide additional context.
What makes this script unique is that it specifically identifies and visualizes a specific technical pattern known as the "Kiss of Death". The "Kiss of Death" is a bearish reversal pattern that occurs when the current price falls below a specific moving average (in this case, a 21-period Exponential Moving Average or EMA) after previously being above it, and when the current low is below the lowest low of the previous two periods.
This script stands out because it provides a clear and visual representation of this particular pattern on a TradingView chart. By using a red, downward-pointing triangle above the bars, it helps traders quickly identify potential bearish reversal points based on the defined conditions.
The combination of a specific pattern, in this case the "Kiss of Death", along with a visual indicator, sets this script apart and makes it a useful tool for traders looking to identify potential bearish reversal points in their technical analysis.
Gap Statistics (Zeiierman)█ Overview
The Gap Statistics (Zeiierman) indicator is crafted to monitor, analyze, and visually present price gaps on a trading chart. Price gaps are areas on a chart where the price jumps up or down from the previous close to the next open, creating a "gap" in the normal price pattern. This script delivers an extensive range of statistics related to these gaps, encompassing their size, direction (whether bullish or bearish), frequency of getting filled, as well as the average number of bars it takes for a gap to be filled. The indicator also visually represents the gaps, making it easier for traders to spot and analyze them.
█ How It Works
Gap Identification: The script identifies gaps by comparing the open price of a bar to the close price of the previous bar. If there is a discrepancy between the two, it is recognized as a gap.
Gap Classification: Once a gap is identified, it is classified based on its size (as a percentage of the previous close price) and direction (bullish or bearish). The gap is then added to a specific category based on its size.
Gap Tracking: The script keeps track of all identified gaps using arrays and user-defined types, storing details like their size, direction, and whether they have been filled.
Gap Filling: The script continuously monitors the price to check if any previously identified gaps get filled. A gap is considered filled if the price moves back into the gap area.
Statistics and Alerts: The script calculates various statistics like the total number of gaps, the number of filled gaps, the average number of bars it takes for a gap to fill, and the percentage of gaps that get filled. It also generates alerts when a new gap is identified or an existing gap gets filled.
█ How to Use
Gaps are often classified into four main types:
Common Gaps: These are not associated with any major news and are likely to get filled quickly.
Breakaway Gaps: These occur at the end of a price pattern and signal the beginning of a new trend.
Runaway Gaps: Also known as continuation gaps, these occur in the middle of a trend and signal a surge in interest in the stock.
Exhaustion Gaps: These occur near the end of a price pattern and signal a final attempt to hit new highs or lows.
The Gap Statistics (Zeiierman) indicator enhances a trader's ability to use gaps in their trading strategy in several ways:
Statistical Analysis: Traders get comprehensive statistics on gaps, such as their size, direction, and how often they get filled.
Performance Tracking: The indicator tracks how many bars it typically takes for a gap to fill, providing traders with an average timeframe for gap closure.
█ Settings
Display Gaps: Choose to display "All Gaps," "Active Gaps," or "None."
Show Gap Size: Toggle on/off the display of the gap size.
-----------------
Disclaimer
The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!
IU Average move How The Script Works :
1. This script calculate the average movement of the price in a user defined custom session and plot the data in a table from on top left corner of the chart.
2. The script takes highest and lowest value of that custom session and store their difference into an array.
3. Then the script average the array thus gets the average price.
4. Addition to that the script converter the price pip change into percentage in order to calculate the value in percentage form.
5. This script is pure price action based the script only take price value and doesn't take any indicator for calculation.
6. The script works on every type of market.
7. If the session is invalid it returns nothing
8. The background color, text color and transparency is changeable.
How User Can Benefit From This Script:
1. User can understand the volatility of any session that he/she wish to trade.
2. It can be helpful for understanding the average price moment of any tradeble asset.
3. It will give the average price movement both in percentage and points bases.
4. By understanding the volatility user can adjust his stop loss or take profit with respect his risk management.
Naresh CE with 13 62 crossThank you to Lauris, for sharing knowledge and logic for the EMA cross-over (13/62).
The provided Pine Script is a custom script, which is designed to display Chandelier Exit levels on the price chart and generate buy and sell labels based on specific conditions.
Here's a breakdown of the key components and logic of the Pine Script:
Exponential Moving Averages (EMAs):
ema1: The 13-period Exponential Moving Average (EMA) of the closing price.
ema2: The 62-period Exponential Moving Average (EMA) of the closing price.
EMA Plotting:
The script plots the ema1 (13 EMA) and ema2 (62 EMA) lines on the price chart using the plot() function.
Chandelier Exit Calculation:
The Chandelier Exit values are calculated using the Average True Range (ATR).
The script calculates the atr (Average True Range) using the atr() function with the given length.
longStop is calculated as the highest price of the specified length minus the ATR, and shortStop is calculated as the lowest price plus the ATR.
Directional Indicator (dir):
The dir variable is used to determine the direction of the Chandelier Exit based on the comparison of the current close price with the previous long and short stops.
Buy and Sell Signals:
The script generates buy signals when the Chandelier Exit direction changes from short to long (buySignal).
Similarly, sell signals are generated when the Chandelier Exit direction changes from long to short (sellSignal).
The conditions for buy and sell signals are based on the value of dir and its previous value.
Buy and Sell Labels:
Buy and sell labels are plotted on the chart using plotshape() based on the generated buy and sell signals.
The showLabels input parameter controls whether to display the buy and sell labels.
Highlighting States:
The script fills the chart area with color (green for long, red for short) based on the direction of the Chandelier Exit values.
The highlightState input parameter controls whether to apply this highlighting.
Alerts:
The script includes alert conditions based on the direction change (changeCond), buy signal (buySignal), and sell signal (sellSignal) using the alertcondition() function.
The script aims to help traders identify potential buy and sell signals based on the Chandelier Exit levels derived from the 13 EMA and 62 EMA crossovers. The Chandelier Exit values can serve as dynamic stop-loss levels for long and short positions.
Auto Fibonacci TP Levels [WJ]This script automatically draws Fibonacci levels on a trading chart which are popular tools for traders seeking to identify potential areas of support and resistance.
Here are the features and benefits of this script:
1. Versatility in Sourcing Trade Entries:
Trade source can be customized to either longs (buying trades) or shorts (selling trades). The user has the flexibility to adjust their entry points based on their trading strategy.
Up to 2 sources can be used, expand if you wish.
As it is coded now, the source you have to pick from has to have a 'plot' that sends a (long) or (short) and is equal to 1 and 2 respectively.
Example: In the script you want to use for Long and Shorts, make a plot like this:
plot(LONG ? 1 : SHORT ? 2 : 0, title = "⭐ Outbound signal", display = display.none, editable = false)
The variable name of the LONG and SHORT needs to be the same as the one your code is using to indicate those trades.
2. Flexible Fibonacci Start Points:
The starting points for drawing Fibonacci levels can be customized for both longs and shorts.
3. Configurable Historical Data Length:
Users can adjust the number of historical bars to analyze for calculating higher highs (HH) and lower lows (LL).
4. Informative Labels and Lines:
The script can be configured to show the distance from the entry point to the 0.618 Fibonacci level (the so-called "golden ratio"). This helps traders to visualize the risk-reward ratio of their trades.
It indicates when a Fibonacci level was crossed which could signal a potential reversal.
It allows users to display the golden pocket levels only (0.618 and 0.65) or all the Fibonacci levels.
5. Customizable Fibonacci Levels and Colors:
Users can define their preferred Fibonacci levels and assign specific colors to each of these levels. This helps in identifying different levels quickly and intuitively.
The script also includes functionality for setting stop loss levels for short and long positions, which helps in risk management.
6. Clear Visualization of Crossing Levels:
If a trade crosses a specific Fibonacci level, the script draws lines indicating the crossing. This can help traders to identify potential breakout or reversal points.
7. Calculation of Fibonacci Boxes:
For each Fibonacci level, the script creates a box that indicates the level's range on the chart. This visual aid can help traders to better understand the price movement within these levels.
8. Customizable Labels:
The script provides percentage difference labels at each Fibonacci level, displaying the difference between the price at that level and the price at the 0 Fibonacci level. This can help users quickly understand the price change in terms of percentage at each level.
9. Performance Efficiency:
The script uses arrays to store and manage the Fibonacci levels and their associated colors. This approach enhances the performance of the script, especially when processing a large amount of data.
10. Adaptability:
This script automatically adapts to market movements. When the price crosses a level, it identifies and records this event, aiding the trader's decision-making process.
Overall, this script is highly customizable, adaptable and provides a clear visual representation of important trading data, making it an effective tool for traders using Fibonacci levels in their strategies.
NOTE: If you can't see the fib lines, it is because they have already been triggered/touched by a candle and they are set to not continue after they are touched.
120x ticker screener (composite tickers)In specific circumstances, it is possible to extract data, far above the 40 `request.*()` call limit for 1 single script .
The following technique uses composite tickers . Changing tickers needs to be done in the code itself as will be explained further.
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
🔶 PRINCIPLE
Standard example:
c1 = request.security('MTLUSDT' , 'D', close)
This will give the close value from 1 ticker (MTLUSDT); c1 for example is 1.153
Now let's add 2 tickers to MTLUSDT; XMRUSDT and ORNUSDT with, for example, values of 1.153 (I), 143.4 (II) and 0.8242 (III) respectively.
Just adding them up 'MTLUSDT+XMRUSDT+ORNUSDT' would give 145.3772 as a result, which is not something we can use...
Let's multiply ORNUSDT by 100 -> 14340
and multiply MTLUSDT by 1000000000 -> 1153000000 (from now, 10e8 will be used instead of 1000000000)
Then we make the sum.
When we put this in a security call (just the close value) we get:
c1 = request.security('MTLUSDT*10e8+XMRUSDT*100+ORNUSDT', 'D', close)
'MTLUSDT*10e8+XMRUSDT*100+ORNUSDT' -> 1153000000 + 14340 + 0.8242 = 1153014340.8242 (a)
This (a) will be split later on, for example:
1153014330.8242 / 10e8 = 1.1530143408242 -> round -> in this case to 1.153 (I), multiply again by 10e8 -> 1153000000.00 (b)
We subtract this from the initial number:
1153014340.8242 (a)
- 1153000000.0000 (b)
–––––––––––––––––
14340.8242 (c)
Then -> 14340.8242 / 100 = 143.408242 -> round -> 143.4 (II) -> multiply -> 14340.0000 (d)
-> subtract
14340.8242 (c)
- 14340.0000 (d)
––––––––––––
0.8242 (III)
Now we have split the number again into 3 tickers: 1.153 (I), 143.4 (II) and 0.8242 (III)
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
In this publication the function compose_3_() will make a composite ticker of 3 tickers, and the split_3_() function will split these 3 tickers again after passing 1 request.security() call.
In this example:
t46 = 'BINANCE:MTLUSDT', n46 = 10e8 , r46 = 3, t47 = 'BINANCE:XMRUSDT', n47 = 10e1, r47 = 1, t48 = 'BINANCE:ORNUSDT', r48 = 4 // T16
•••
T16= compose_3_(t48, t47, n47, t46, n46)
•••
= request.security(T16, res, )
•••
= split_3_(c16, n46, r46, n47, r47, r48)
🔶 CHANGING TICKERS
If you need to change tickers, you only have to change the first part of the script, USER DEFINED TICKERS
Back to our example, at line 26 in the code, you'll find:
t46 = 'BINANCE:MTLUSDT', n46 = 10e8 , r46 = 3, t47 = 'BINANCE:XMRUSDT', n47 = 10e1, r47 = 1, t48 = 'BINANCE:ORNUSDT', r48 = 4 // T16
( t46 , T16 ,... will be explained later)
You need to figure out how much you need to multiply each ticker, and the number for rounding, to get a good result.
In this case:
'BINANCE:MTLUSDT', multiply number = 10e8, round number is 3 (example value 1.153)
'BINANCE:XMRUSDT', multiply number = 10e1, round number is 1 (example value 143.4)
'BINANCE:ORNUSDT', NO multiply number, round number is 4 (example value 0.8242)
The value with most digits after the decimal point by preference is placed to the right side (ORNUSDT)
If you want to change these 3, how would you do so?
First pick your tickers and look for the round values, for example:
'MATICUSDT', example value = 0.5876 -> round -> 4
'LTCUSDT' , example value = 77.47 -> round -> 2
'ARBUSDT' , example value = 1.0231 -> round -> 4
Value with most digits after the decimal point -> MATIC or ARB, let's pick ARB to go on the right side, LTC at the left of ARB, and MATIC at the most left side.
-> 'MATICUSDT', LTCUSDT', ARBUSDT'
Then check with how much 'LTCUSDT' and 'MATICUSDT' needs to be multiplied to get this: 5876 0 7747 0 1.0231
'MATICUSDT' -> 10e10
'LTCUSDT' -> 10e3
Replace:
t46 = 'BINANCE:MTLUSDT', n46 = 10e8 , r46 = 3, t47 = 'BINANCE:XMRUSDT', n47 = 10e1, r47 = 1, t48 = 'BINANCE:ORNUSDT', r48 = 4 // T16
->
t46 = 'BINANCE:MATICUSDT', n46 = 10e10 , r46 = 4, t47 = 'BINANCE:LTCUSDT', n47 = 10e3, r47 = 2, t48 = 'BINANCE:ARBUSDT', r48 = 4 // T16
DO NOT change anything at t46, n46,... if you don't know what you're doing!
Only
• tickers ('BINANCE:MTLUSDT', 'BINANCE:XMRUSDT', 'BINANCE:ORNUSDT', ...),
• multiply numbers (10e8, 10e1, ...) and
• round numbers (3, 1, 4, ...)
should be changed.
There you go!
🔶 LIMITATIONS
🔹 The composite ticker fails when 1 of the 3 isn't in market in the weekend, while the other 2 are.
That is the reason all tickers are crypto. I think it is possible to combine stock,... tickers, but they have to share the same market hours.
🔹 The number cannot be as large as you want, the limit lays around 15-16 digits.
This means when you have for example 123, 45.67 and 0.000000000089, you'll get issues when composing to this:
-> 123045670.000000000089 (21 digits)
Make sure the numbers are close to each other as possible, with 1 zero (or 2) in between:
-> 1.230045670089 (13 digits by doing -> (123 * 10e-3) + (45.67 * 10e-7) + 0.000000000089)
🔹 This script contains examples of calculated values, % change, SMA, RMA and RSI.
These values need to be calculated from HTF close data at current TF (timeframe).
This gives challenges. For example the SMA / %change is not a problem (same values at 1h TF from Daily data).
RMA , RSI is not so easy though...
Daily values are rather similar on a 2-3h TF, but 1h TF and lower is quite different.
At the moment I haven't figured out why, if someone has an idea, don't hesitate to share.
The main goal of this publication is 'composite tickers ~ request.security()' though.
🔹 When a ticker value changes substantially (x10, x100), the multiply number needs to be adjusted accordingly.
🔶 SETTINGS
SHOW SETS
SET
• Length : length of SMA, RMA and RSI
• HTF : Higher TimeFrame (default Daily)
TABLE
• Size table : \ _ Self-explanatory
• Include exchange name : /
• Sort : If exchange names are shown, the exchanges will be sorted first
COLOURS
• CH%
• RSI
• SMA (RMA)
DEBUG
Remember t46 , T16 ,... ?
This can be used for debugging/checking
ALWAYS DISABLE " sort " when doing so.
Example:
Set string -> T1 (tickers FIL, CAKE, SOL)
(Numbers are slightly different due to time passing by between screen captures)
Placing your tickers at the side panel makes it easy to compare with the printed label below the table (right side, 332201415014.45 ),
together with the line T1 in the script:
t1 = 'BINANCE:FILUSDT' , n1 = 10e10, r1 = 4, t2 = 'BINANCE:CAKEUSDT' , n2 = 10e5 , r2 = 3, t3 = 'BINANCE:SOLUSDT' , r3 = 2 // T1
FIL : 3.322
CAKE: 1.415
SOL : 14.56
Now it is easy to check whether the tickers are placed close enough to each other, with 1-2 zero's in between.
If you want to check a specific ticker, use " Show Ticker" , see out initial example:
Set string -> T16
Show ticker -> 46 (in the code -> t46 = 'BINANCE:MTLUSDT')
(Set at 0 to disable " check string " and NONE to disable " Set string ")
-> Debug/check/set away! 😀
🔶 OTHER TECHNIQUES
• REGEX ( Regular expression ) and str.match() is used to delete the exchange name from the ticker, in other words, everything before ":" is deleted by following regex:
exch(t) => incl_exch ? t : str.match(t, "(?<=:) +")
• To sort, array.sort_indices() is used (line 675 in the code), just as in my first "sort" publication Sort array alphabetically - educational
aSort = arrT.copy()
sort_Indices = array.sort_indices(id= aSort, order= order.ascending)
• Numbers and text colour will adjust automatically when switching between light/dark mode by using chart.fg_color / chart.bg_color
🔹 DISCLAIMER
Please don't ask me for custom screeners, thank you.
Parabolic Scalp Take Profit[ChartPrime]Indicators can be a great way to signal when the optimal time is for taking profits. However, many indicators are lagging in nature and will get market participants out of their trades at less than optimal price points. This take profit indicator uses the concept of slope and exponential gain to calculate when the optimal time is to take profits on your trades, thus making this a leading indicator.
Usage:
In essence the indicator will draw a parabolic line that starts from the market participants entry point and exponentially grows the slope of the line eventually intersecting with the price action. When price intersects with the parabolic line a take profit signal will appear in the form of an x. We have found that this take profit indicator is especially useful for scalp trades on lower timeframes.
How To Use:
Add the indicator to the chart. Click on the candle which the trade is on. Click on either the price which the trade will be at, or at the bottom of the candle in a long, or the top of a candle in a short. Select long or short. Open the settings of the indicator and adjust the aggressiveness to the desired value.
Settings:
- Start Time -- This is the bar in which your entry will be at, or occured at and the script will ask you to click on the bar with your mouse upon first adding the script.
- Start Price -- This is the price in which the entry will be at, or was at and the script will ask you to click on the price with your mouse upon first adding the script.
- Long/Short -- This is a setting which lets the script know if it is a long or a short trade, and the script will ask you to confirm this upon first adding it to the chart.
- Aggressiveness -- This directly affects how aggressive the exponential curve is. A value of 101 is the lowest possible setting, indicating a very non-aggressive exponential buildup. A value of 200 is the highest and most aggressive setting, indicating a doubling effect per bar on the slope.
Bollinger Bands SignalsDescription:
This indicator works well in trendy markets on long runs and in mean-reverting markets, at almost any timeframe.
That said, higher timeframes are much preferred for their intrinsic ability to cut out noise. The example chart is in 3H TF.
Be mindful, the script shows somewhat erratic jigsaw-like behaviour during consolidation periods when the price
jumps up and down in indecision which way to go. Fortunately, there are scripts out there that detect such periods.
You can choose between 4 Moving Averages, Vidya being the default. Period, Deviation and Bands Width parameters
all of them affect the signal generation.
For the Pine Script coder this script is pretty obvious.
It uses a standard technical analysis indicator - Bollinger Bands - and appends it with a 'width' parameter and
a signal generation procedure.
The signal generation procedure is the heart of this script that keeps the script pumping signals.
The BB width is used as a filter.
You can use this procedure in your own scripts and it will continue generate signals according to your rules.
Percent Levels From Previous CloseThis indicator plots on the chart +/- 1% / 2% / 3% ranges based on the previous day's close levels.
Disclaimer :
Success in trading is all about following your trading strategy and indicators should fit into your own strategy, and not be traded purely on.
This script is for informational and educational purposes only. Use of the script does not constitute professional and / or financial advice. You are solely responsible for evaluating the outcome of the script and the risks associated with using the script. In exchange for the use of the script, you agree not to hold monpotejulien TradingView user responsible for any possible claims for damages arising out of any decisions you make based on the use of the script.
[CLX][#04] Progress BarsFully customizable progress bars. 🚥
Functions:
- f_pbar() - 2 color, single argument version
- f_bar_theme() - multi color, array version
A detailed description will follow in the next few days.
Feel free to contribute for an extended version. 😊 Still in development.
We hope you enjoy it! 🎉
CRYPTOLINX - jango_blockchained 😊👍
Disclaimer:
Trading success is all about following your trading strategy and the indicators should fit within your trading strategy, and not to be traded upon solely.
The script is for informational and educational purposes only. Use of the script does not constitute professional and/or financial advice. You alone have the sole responsibility of evaluating the script output and risks associated with the use of the script. In exchange for using the script, you agree not to hold cryptolinx TradingView user liable for any possible claim for damages arising from any decision you make based on use of the script.
Machine Learning / Longs [Experimental]Hello Traders/Programmers,
For long time I thought that if it's possible to make a script that has own memory and criterias in Pine. it would learn and find patterns as images according to given criterias. after we have arrays of strings, lines, labels I tried and made this experimental script. The script works only for Long positions.
Now lets look at how it works:
On each candle it creates an image of last 8 candles. before the image is created it finds highest/lowest levels of 8 candles, and creates a string with the lengths 64 (8 * 8). and for each square, it checks if it contains wick, green or red body, green or red body with wicks. see the following picture:
Each square gets the value:
0: nothing in it
1: only wick in it
2: only red body in it
3. only green body in it
4: red body and wick in it
5: green body and wick in it
And then it checks if price went up equal or higher than user-defined profit. if yes then it adds the image to the memory/array. and I call this part as Learning Part.
what I mean by image is:
if there is 1 or more element in the memory, it creates image for current 8 candles and checks the memory if there is a similar images. If the image has similarity higher than user-defined similarty level then if show the label "Matched" and similarity rate and the image in the memory. if it find any with the similarity rate is equal/greater than user-defined level then it stop searching more.
As an example matched image:
and then price increased and you got the profit :)
Options:
Period: if there is possible profit higher than user-defined minimum profit in that period, it checks the images from 2. to X. bars.
Min Profit: you need to set the minimum expected profit accordingly. for example in 1m chart don't enter %10 as min profit :)
Similarity Rate: as told above, you can set minimum similarity rate, higher similarity rate means better results but if you set higher rates, number of images will decrease. set it wisely :)
Max Memory Size: you can set number of images (that gives the profit equal/higher than you set) to be saved that in memory
Change Bar Color: optionally it can change bar colors if current image is found in the memory
Current version of the script doesn't check if the price reach the minimum profit target, so no statistics.
This is completely experimental work and I made it for fun. No one or no script can predict the future. and you should not try to predict the future.
P.S. it starts searching on last bar, it doesn't check historical bars. if you want you should check it in replay mode :)
if you get calculation time out error then hide/unhide the script. ;)
Enjoy!
Uptrick: Smart BoundariesThis script is an indicator that combines the RSI (Relative Strength Index) and Bollinger Bands to highlight potential points where price momentum and volatility may both be at extreme levels. Below is a detailed explanation of its components, how it calculates signals, and why these two indicators have been merged into one tool. This script is intended solely for educational purposes and for traders who want to explore the combined use of momentum and volatility measures. Please remember that no single indicator guarantees profitable results.
Purpose of This Script
This script is designed to serve as a concise, all-in-one tool for traders seeking to track both momentum and volatility extremes in real time. By overlaying RSI signals with Bollinger Band boundaries, it helps users quickly identify points on a chart where price movement may be highly stretched. The goal is to offer a clearer snapshot of potential overbought or oversold conditions without requiring two separate indicators. Additionally, its optional pyramiding feature enables users to manage how many times they initiate trades when signals repeat in the same direction. Through these combined functions, the script aims to streamline technical analysis by consolidating two popular measures—momentum via RSI and volatility via Bollinger Bands—into a single, manageable interface.
1. Why Combine RSI and Bollinger Bands
• RSI (Relative Strength Index): This is a momentum oscillator that measures the speed and magnitude of recent price changes. It typically ranges between 0 and 100. Traders often watch for RSI crossing into “overbought” or “oversold” levels because it may indicate a potential shift in momentum.
• Bollinger Bands: These bands are plotted around a moving average, using a standard deviation multiplier to create an upper and lower boundary. They help illustrate how volatile the price has been relative to its recent average. When price moves outside these boundaries, some traders see it as a sign the price may be overstretched and could revert closer to the average.
Combining these two can be useful because it blends two different perspectives on market movement. RSI attempts to identify momentum extremes, while Bollinger Bands track volatility extremes. By looking for moments when both conditions agree, the script tries to highlight points where price might be unusually stretched in terms of both momentum and volatility.
2. How Signals Are Generated
• Buy Condition:
- RSI dips below a specified “oversold” level (for example, 30 by default).
- Price closes below the lower Bollinger Band.
When these occur together, the script draws a label indicating a potential bullish opportunity. The underlying reasoning is that momentum (RSI) suggests a stronger-than-usual sell-off, and price is also stretched below the lower Bollinger Band.
• Sell Condition:
- RSI rises above a specified “overbought” level (for example, 70 by default).
- Price closes above the upper Bollinger Band.
When these occur together, a label is plotted for a potential bearish opportunity. The rationale is that momentum (RSI) may be overheated, and the price is trading outside the top of its volatility range.
3. Pyramiding Logic and Trade Count Management
• Pyramiding refers to taking multiple positions in the same direction when signals keep firing. While some traders prefer just one position per signal, others like to scale into a trade if the market keeps pushing in their favor.
• This script uses variables that keep track of how many recent buy or sell signals have fired. If the count reaches a user-defined maximum, no more signals of that type will trigger additional labels. This protects traders from over-committing to one direction if the market conditions remain “extreme” for a prolonged period.
• If you disable the pyramiding feature, the script will only plot one label per side until the condition resets (i.e., until RSI and price conditions are no longer met).
4. Labels and Visual Feedback
• Whenever a buy or sell condition appears, the script plots a label directly on the chart:
- Buy labels under the price bar.
- Sell labels above the price bar.
These labels make it easier to review where both RSI and Bollinger Band conditions align. It can be helpful for visually scanning the chart to see if the signals show any patterns related to market reversals or trend continuations.
• The Bollinger Bands themselves are plotted so traders can see when the price is approaching or exceeding the upper or lower band. Watching the RSI and Bollinger Band plots simultaneously can give traders more context for each signal.
5. Originality and Usefulness
This script provides a distinct approach by merging two well-established concepts—RSI and Bollinger Bands—within a single framework, complemented by optional pyramiding controls. Rather than using each indicator separately, it attempts to uncover moments when momentum signals from RSI align with volatility extremes highlighted by Bollinger Bands. This combined perspective can aid in spotting areas of possible overextension in price. Additionally, the built-in pyramiding mechanism offers a method to manage multiple signals in the same direction, allowing users to adjust how aggressively they scale into trades. By integrating these elements together, the script aims to deliver a tool that caters to diverse trading styles while remaining straightforward to configure and interpret.
6. How to Use the Indicator
• Configure the Inputs:
- RSI Length (the lookback period used for the RSI calculation).
- RSI Overbought and Oversold Levels.
- Bollinger Bands Length and Multiplier (defines the moving average period and the degree of deviation).
- Option to reduce pyramiding.
• Set Alerts (Optional):
- You can create TradingView alerts for when these conditions occur, so you do not have to monitor the chart constantly. Choose the buy or sell alert conditions in your alert settings.
• Integration in a Trading Plan:
- This script alone is not a complete trading system. Consider combining it with other forms of analysis, such as support and resistance, volume profiles, or candlestick patterns. Thorough research, testing on historical data, and risk management are always recommended.
7. No Performance Guarantees
• This script does not promise any specific trading results. It is crucial to remember that no single indicator can accurately predict future market movements all the time. The script simply tries to highlight moments when two well-known indicators both point to an extreme condition.
• Actual trading decisions should factor in a range of market information, including personal risk tolerance and broader market conditions.
8. Purpose and Limitations
• Purpose:
- Provide a combined view of momentum (RSI) and volatility (Bollinger Bands) in a single script.
- Assist in spotting times when price may be at an extreme.
- Offer a configurable system for labeling potential buy or sell points based on these extremes.
• Limitations:
- Overbought and oversold conditions can persist for an extended period in trending markets.
- Bollinger Band breakouts do not always result in immediate reversals. Sometimes price keeps moving in the same direction.
- The script does not include a built-in exit strategy or risk management rules. Traders must handle these themselves.
Additional Disclosures
This script is published open-source and does not rely on any external or private libraries. It does not use lookahead methods or repaint signals; all calculations are performed on the current bar without referencing future data. Furthermore, the script is designed for standard candlestick or bar charts rather than non-standard chart types (e.g., Heikin Ashi, Renko). Traders should keep in mind that while the script can help locate potential momentum and volatility extremes, it does not include an exit strategy or account for factors like slippage or commission. All code comes from built-in Pine Script functions and standard formulas for RSI and Bollinger Bands. Anyone reviewing or modifying this script should exercise caution and incorporate proper risk management when applying it to their own trading.
Calculation Details
The script computes RSI by examining a user-defined number of prior bars (the RSI Length) and determining the average of up-moves relative to the average of down-moves over that period. This ratio is then scaled to a 0–100 range, so lower values typically indicate stronger downward momentum, while higher values suggest stronger upward momentum. In parallel, Bollinger Bands are generated by first calculating a simple moving average (SMA) of the closing price for the user-specified length. The script then measures the standard deviation of closing prices over the same period and multiplies it by the chosen factor (the Bollinger Bands Multiplier) to form the upper and lower boundaries around the SMA. These two measures are checked in tandem: if the RSI dips below a certain oversold threshold and price trades below the lower Bollinger Band, a condition is met that may imply a strong short-term sell-off; similarly, if the RSI surpasses the overbought threshold and price rises above the upper Band, it may indicate an overextended move to the upside. The pyramiding counters track how many of these signals occur in sequence, preventing excessive stacking of labels on the chart if conditions remain extreme for multiple bars.
Conclusion
This indicator aims to provide a more complete view of potential market extremes by overlaying the RSI’s momentum readings on top of Bollinger Band volatility signals. By doing so, it attempts to help traders see when both indicators suggest that the market might be oversold or overbought. The optional reduced pyramiding logic further refines how many signals appear, giving users the choice of a single entry or multiple scaling entries. It does not claim any guaranteed success or predictive power, but rather serves as a tool for those wanting to explore this combined approach. Always be cautious and consider multiple factors before placing any trades.
SMA Proximity Signal with Trend TableSummary of the Script:
This Pine Script is designed to provide a variety of technical analysis signals based on Simple Moving Averages (SMAs) and market trends across different timeframes. The script combines multiple indicators, such as the SMA crossover, proximity conditions, and trend analysis, along with visual markers and support/resistance lines. Below is a detailed breakdown of the key features:
The script detects crossovers between SMA1 and SMA2 and SMA1 and SMA3, marking them with green circles exactly at the crossover price level (not on the candles).
The crossover events are identified using ta.crossover and ta.crossunder functions.
Additional circles are drawn when other SMAs are in proximity (narrow stage)
Elephant Candle Pattern:
The script identifies "Elephant Candles" based on a large candle body relative to the overall size of the candle, using the condition where the candle body is at least 80% of the total candle size and at least 1.5 times the average candle size.
These candles are marked with an elephant emoji 🐘 at the top of the candle.
Trend Analysis Across Multiple Timeframes:
The script calculates the trend for different timeframes using the SMA20 of each timeframe:
5m, 15m, 1h, 4h, and 1D
It compares the current SMA20 to its previous value to determine whether the trend is Up, Down, or Flat.
MktCumTickThis script is a market sentiment indicator that calculates the cumulative TICK (Trade Imbalance Sentiment) for four major markets: NYSE (New York Stock Exchange), NASDAQ (National Association of Securities Dealers Automated Quotations), Dow Jones, and AMEX (American Stock Exchange).
Here's a breakdown of the script:
1. Market data requests: The script requests data for the four markets, including:
- TICK (Trade Imbalance Sentiment) data
- HLC3 (High, Low, Close) data
- ADVN (Advancing issues), DECL (Declining issues), and UNCH (Unchanged issues) data
2. Cumulative TICK calculation: The script calculates the cumulative TICK for each market by dividing the TICK data by the maximum TICK value for each market.
3. Plotting: The script plots the cumulative TICK values for each market as separate lines on the chart.
4. Background color: The script changes the background color of the chart based on the cumulative TICK values. If all four markets have decreasing cumulative TICK values, the background color turns red. If all four markets have increasing cumulative TICK values, the background color turns green.
The purpose of this indicator is to provide a visual representation of market sentiment across multiple markets. By analyzing the cumulative TICK values, traders can gain insights into market trends and make more informed trading decisions.
Some possible uses of this indicator include:
- Identifying market trends and sentiment
- Confirming trade entries and exits
- Monitoring market conditions and adjusting trading strategies accordingly
Weekly Bullish Pattern DetectorThis script is a TradingView Pine Script designed to detect a specific bullish candlestick pattern on the weekly chart. Below is a detailed breakdown of its components:
1. Purpose
The script identifies a four-candle bullish pattern where:
The first candle is a long green (bullish) candlestick.
The second and third candles are small-bodied candles, signifying consolidation or indecision.
The fourth candle is another long green (bullish) candlestick.
When this pattern is detected, the script:
Marks the chart with a visual label.
Optionally triggers an alert to notify the trader.
2. Key Features
Overlay on Chart:
indicator("Weekly Bullish Pattern Detector", overlay=true) ensures the indicator draws directly on the price chart.
Customizable Inputs:
length (Body Size Threshold):
Defines the minimum percentage of the total range that qualifies as a "long" candle body (default: 14%).
smallCandleThreshold (Small Candle Body Threshold):
Defines the maximum percentage of the total range that qualifies as a "small" candle body (default: 10%).
Candlestick Property Calculations:
bodySize: Measures the absolute size of the candle body (close - open).
totalRange: Measures the total high-to-low range of the candle.
bodyPercentage: Calculates the proportion of the body size relative to the total range ((bodySize / totalRange) * 100).
isGreen and isRed: Identify bullish (green) or bearish (red) candles based on their open and close prices.
Pattern Conditions:
longGreenCandle:
Checks if the candle is bullish (isGreen) and its body percentage exceeds the defined length threshold.
smallCandle:
Identifies small-bodied candles where the body percentage is below the smallCandleThreshold.
consolidation:
Confirms the second and third candles are both small-bodied (smallCandle and smallCandle ).
Bullish Pattern Detection:
bullishPattern:
Detects the full four-candle sequence:
The first candle (longGreenCandle ) is a long green candle.
The second and third candles (consolidation) are small-bodied.
The fourth candle (longGreenCandle) is another long green candle.
Visualization:
plotshape(bullishPattern):
Draws a green label ("Pattern") below the price chart whenever the pattern is detected.
Alert Notification:
alertcondition(bullishPattern):
Sends an alert with the message "Bullish Pattern Detected on Weekly Chart" whenever the pattern is found.
3. How It Works
Evaluates Candle Properties:
For each weekly candle, the script calculates its size, range, and body percentage.
Identifies Each Component of the Pattern:
Checks for a long green candle (first and fourth).
Verifies the presence of two small-bodied candles (second and third).
Detects and Marks the Pattern:
Confirms the sequence and marks the chart with a label if the pattern is complete.
Sends Alerts:
Notifies the trader when the pattern is detected.
4. Use Cases
This script is ideal for:
Swing Traders:
Spotting weekly patterns that indicate potential bullish continuations.
Breakout Traders:
Identifying consolidation zones followed by upward momentum.
Pattern Recognition:
Automatically detecting a commonly used bullish formation.
5. Key Considerations
Timeframe: Works best on weekly charts.
Customization: The thresholds for "long" and "small" candles can be adjusted to suit different markets or volatility levels.
Limitations:
It doesn't confirm the pattern's success; further analysis (e.g., volume, support/resistance levels) may be required for validation
FVG - NibzDescription: Fair Value Gap (FVG) Indicator - Nibz
This Pine Script identifies and visualizes Fair Value Gaps (FVGs) on your TradingView chart. FVGs are price inefficiencies left behind when the market moves too quickly, skipping price levels that might not be tested. These gaps often act as magnets, attracting price for potential reversals or continuations.
The script works by detecting upward (bullish) and downward (bearish) price imbalances based on specific candlestick criteria and then marks these zones on your chart using customizable shaded boxes. This tool is essential for traders looking to identify key areas of market inefficiency that could signify support/resistance levels, potential reversal zones, or areas to monitor for market rebalancing.
How It Works
1. Bullish FVG Detection
The script identifies an upward imbalance when:
The low of the candlestick two bars back is less than or equal to the open of the previous bar.
The high of the current candlestick is greater than or equal to the close of the previous bar.
When this condition is met and the size of the imbalance is greater than zero, a green box is drawn from the low of the second candlestick back to the high of the current candlestick.
2. Bearish FVG Detection
The script identifies a downward imbalance when:
The high of the candlestick two bars back is greater than or equal to the open of the previous bar.
The low of the current candlestick is less than or equal to the close of the previous bar.
When this condition is met and the size of the imbalance is greater than zero, a red box is drawn from the low of the current candlestick to the high of the second candlestick back.
Customization Options
This script is highly customizable, allowing you to tailor the appearance of the FVG boxes to suit your trading style and chart aesthetics:
Bullish FVG:
Fill color and transparency.
Border color and transparency.
Bearish FVG:
Fill color and transparency.
Border color and transparency.
The settings are user-friendly, with intuitive sliders for transparency and color pickers for customization.
How to Use the Indicator
Adding the Script:
Add the indicator to your chart, and it will automatically mark bullish (green) and bearish (red) FVGs.
Interpreting FVGs:
Bullish FVGs (green zones): These often act as support or areas of potential price rebalancing on retracement.
Bearish FVGs (red zones): These often act as resistance or areas of interest for short entries.
Trade Ideas:
Use FVG zones to confirm other trade signals or strategies.
Watch for price interaction with these zones to time entries and exits.
Key Features
Automated detection of Fair Value Gaps.
Customizable visual representation to match your chart preferences.
Enhances trading precision by identifying price inefficiencies.
Suitable for scalping, day trading, or swing trading strategies.
This script provides a powerful tool to highlight important price levels and inefficiencies in the market, enabling traders to make informed decisions. Whether you're using it as a standalone indicator or combining it with other tools, the 'FVG - Nibz' indicator is a valuable addition to any trader's toolkit!